<?php
header("Content-type: text/html; charset=utf-8");
$type=trim(htmlspecialchars($_POST['type']));
$money=trim(htmlspecialchars($_POST['money']));
$oid=trim(htmlspecialchars($_POST['oid']));
if($type==1){$typename="支付宝";}
if($type==2){$typename="微信";}
if($type==3){$typename="QQ钱包";}
require 'msg/PHPMailerAutoload.php';
$mail=new PHPMailer();
$body=$typename ."充值" .$money ."元，订单" .$oid;
$mail->IsSMTP();
$mail->SMTPAuth=true;
$mail->SMTPKeepAlive=true;
$mail->SMTPSecure= "ssl";
$mail->Host="smtp.qq.com";
$mail->Port=465;
$mail->Username="888@qq.com";//email账号
$mail->Password="wlvlsyaopheabhhd";#授权码
$mail->From="888@qq.com";//发送方
$mail->FromName="发送方名称";//发送方名称
$mail->Subject=$typename ."充值" .$money ."元，订单" .$oid;
$mail->AltBody=$body;
$mail->WordWrap=50;
$mail->MsgHTML($body);
$mail->AddReplyTo("888@qq.com","回复地址");//回复地址
$mail->AddAddress("888@qq.com","hello");//接收方的邮箱和姓名
$mail->IsHTML(true);
if(!$mail->Send()){
	echo "错误 Mailer Error:".$mail->ErrorInfo;
}else{
	echo "<script content='text/html;charset=utf-8' type='text/javascript'>alert('您充值的金币将在5分钟内到达账户');</script>";
	echo "<script charset=utf-8 type='text/javascript'>document.onload = window.close();</script>";
}